package com.glsc.ngateway.common.xir.domain;

import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 标的金融工具表
 */
@Data
@Entity
@Table(name = "XIR_MD.TBND")
@IdClass(TbndMKey.class)
public class Tbnd implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @Column(name = "I_CODE", nullable = false)
    private String iCode;

    @Id
    @Column(name = "A_TYPE", nullable = false)
    private String aType;

    @Id
    @Column(name = "M_TYPE", nullable = false)
    private String mType;

    @Column(name = "SH_CODE")
    private String shCode;

    @Column(name = "SZ_CODE")
    private String szCode;

    @Column(name = "YH_CODE")
    private String yhCode;

    @Column(name = "CURRENCY", nullable = false)
    private String currency;

    @Column(name = "COUNTRY", nullable = false)
    private String country;

    @Column(name = "Q_TYPE", nullable = false)
    private String qType;

    @Column(name = "B_NAME")
    private String bName;

    @Column(name = "P_CLASS")
    private String pClass;

    @Column(name = "B_PAR_VALUE")
    private String bParValue;

    @Column(name = "B_ISSUE_PRICE")
    private String bIssuePrice;

    @Column(name = "B_ISSUE_DATE")
    private String bIssueDate;

    @Column(name = "B_LIST_DATE")
    private String bListDate;

    @Column(name = "B_START_DATE")
    private String bStartDate;

    @Column(name = "B_MTR_DATE")
    private String bMtrDate;

    @Column(name = "B_TERM")
    private String bTerm;

    @Column(name = "B_DAYCOUNT")
    private String bDaycount;

    @Column(name = "I_CODE_BENCH")
    private String iCodeBench;

    @Column(name = "A_TYPE_BENCH")
    private String aTypeBench;

    @Column(name = "M_TYPE_BENCH")
    private String mTypeBench;

    @Column(name = "B_ISSUE_MODE")
    private String bIssueMode;

    @Column(name = "B_COUPON_TYPE")
    private String bCouponType;

    @Column(name = "B_CASH_TIMES")
    private String bCashTimes;

    @Column(name = "B_EMBOPT_TYPE")
    private String bEmboptType;

    @Column(name = "B_AMORTIZING")
    private String bAmortizing;

    @Column(name = "B_AS_TYPE")
    private String bAsType;

    @Column(name = "B_ISSUER")
    private String bIssuer;

    @Column(name = "B_WARRANTOR")
    private String bWarrantor;

    @Column(name = "B_SENIORITY")
    private String bSeniority;

    @Column(name = "B_FPML")
    private String bFpml;

    @Column(name = "IMP_DATE")
    private String impDate;

    @Column(name = "PIPE_ID")
    private String pipeId;

    @Column(name = "B_COUPON")
    private String bCoupon;

    /**
     * 债券全称
     */
    @Column(name = "B_NAME_FULL")
    private String bNameFull;

    /**
     * 债券实际到期日
     */
    @Column(name = "B_ACTUAL_MTR_DATE")
    private String bActualMtrDate;

    @Column(name = "D_CODE")
    private String dCode;

    /**
     * 最新债项评级
     */
    @Column(name = "B_EXT_RATING")
    private String bExtRating;

    /**
     * 最新债项评级机构
     */
    @Column(name = "B_EXT_RATING_INSTITUTION")
    private String bExtRatingInstitution;

    /**
     * 衡泰资讯原始债券分类
     */
    @Column(name = "B_P_CLASS")
    private String bPClass;

    /**
     * 最新发行人评级
     */
    @Column(name = "B_ISSUER_EXT_RATING")
    private String bIssuerExtRating;

    /**
     * 最新发行人评级机构
     */
    @Column(name = "B_ISSUER_EXT_R_INSTITUTION")
    private String bIssuerExtRInstitution;

    /**
     * 实际发行量
     */
    @Column(name = "B_ACTUAL_ISSUE_AMOUNT")
    private String bActualIssueAmount;

    /**
     * 托管场所
     */
    @Column(name = "HOST_MARKET")
    private String hostMarket;

    /**
     * 一级市场簿记场所
     */
    @Column(name = "BJ_MARKET")
    private String bjMarket;

    @Column(name = "IMP_TIME")
    private String impTime;

    /**
     * 修改人
     */
    @Column(name = "UPDATE_USER")
    private String updateUser;

    /**
     * 修改时间(YYYY-MM-DD HH24:MI:SS)
     */
    @Column(name = "UPDATE_TIME")
    private String updateTime;

    /**
     * 债券行权登记预计公告日
     */
    @Column(name = "B_EXERCISE_EXPECTED_DATE")
    private String bExerciseExpectedDate;

    /**
     * 清算所债券在中债登簿记的债券报文代码(主要对于在中债登波及，清算所托管的债券)
     */
    @Column(name = "I_CODE_CBGS")
    private String iCodeCbgs;

    /**
     * 摘牌日
     */
    @Column(name = "B_DELIST_DATE")
    private String bDelistDate;

    /**
     * 万得一级分类
     */
    @Column(name = "WIND_CLASS1")
    private String windClass1;

    /**
     * 万得二级分类
     */
    @Column(name = "WIND_CLASS2")
    private String windClass2;

    /**
     * 是否公开发行 0：否 1：是
     */
    @Column(name = "PUBLIC_ISSUE")
    private String publicIssue;

    /**
     * 是否永续债，0：否；1：是
     */
    @Column(name = "PERPETUAL")
    private String perpetual;

    /**
     * 备注
     */
    @Column(name = "REMARK")
    private String remark;

    /**
     * 税率优惠比例
     */
    @Column(name = "TAXRATEDISCOUNT")
    private String taxratediscount;

    /**
     * 债券全称2，用于ABS限额遍历
     */
    @Column(name = "B_NAME_FULL2")
    private String bNameFull2;

    /**
     * 第1位:是否可转股,第2位:是否可赎回,第3位:是否可回售,第4位:是否可转为相关债券(固息转浮息、浮息转固息),第5位:是否公开发行,第6位:是否永续,第7位:是否自贸区,第8位:是否权益类标识,第9位:利率债/信用债(0未划分1信用债2利率债)
     */
    @Column(name = "B_EXTEND_TYPE")
    private String bExtendType;

    /**
     * 行权类型，A：美式 B：百慕大 E：欧式
     */
    @Column(name = "B_EXERCISE_STYLE")
    private String bExerciseStyle;

    /**
     * 增信方式
     */
    @Column(name = "TRUSTENHANCING_TYPE")
    private String trustenhancingType;

    /**
     * 第三方担保
     */
    @Column(name = "THIRDPARTY_GUARANTEES")
    private String thirdpartyGuarantees;

    /**
     * 中债登债券简称
     */
    @Column(name = "CBGS_NAME")
    private String cbgsName;

    /**
     * 发行人代码
     */
    @Column(name = "ISSUER_CODE")
    private String issuerCode;

    /**
     * 现金流测试（默认：0,0通过,1不通过,2不确定状态,3通过申请中,4通过申请待复核,5目前没有使用的状态,6不通过申请中,7不通过申请待复核,8目前没有使用的状态2,9有条件通过）
     */
    @Column(name = "SPPI_TEST_RESULT")
    private String sppiTestResult;

    /**
     * 是否允许自动修改SPPI
     */
    @Column(name = "IS_SPPI_ALLOW_ADJ")
    private String sppiAllowAdj;

    /**
     * 提前终止日
     */
    @Column(name = "B_TERMINATEION_DATE")
    private String bTerminateionDate;

    /**
     * 是否城投债，0：否；1：是
     */
    @Column(name = "IS_CITY_INVESTMENT")
    private String cityInvestment;

    /**
     * 是否隐藏
     */
    @Column(name = "IS_HIDE")
    private String hide;

    /**
     * 用户指定到期日
     */
    @Column(name = "B_USER_MTR_DATE")
    private String bUserMtrDate;

    /**
     * 报价面值，0：报价以债券面值报价；其它值为报价面值
     */
    @Column(name = "Q_PAR_VALUE")
    private String qParValue;

    /**
     * 标准类型
     */
    @Column(name = "S_TYPE")
    private String sType;

    /**
     * 前台应计利息计息基准
     */
    @Column(name = "AI_DAYCOUNT")
    private String aiDaycount;

    /**
     * 前台到期收益率计息基准
     */
    @Column(name = "YTM_DAYCOUNT")
    private String ytmDaycount;

    /**
     * 风险国别/区域
     */
    @Column(name = "RISK_COUNTRY")
    private String riskCountry;

    /**
     * 提前到期日
     */
    @Column(name = "B_EARLY_MTR_DATE")
    private String bEarlyMtrDate;

    /**
     * 是否是不规则债券：2表示规则，1表示不规则
     */
    @Column(name = "B_REGULARTYPE")
    private String bRegulartype;

    /**
     * 发行参考收益率
     */
    @Column(name = "REF_YIELD")
    private String refYield;

    /**
     * 协议增信人
     */
    @Column(name = "MUTUALER")
    private String mutualer;

    /**
     * 招标发行系统 1.财政部政府债券发行系统
     * 2.财政部上海证券交易所政府债券发行系统
     * 3.财政部深圳证券交易所政府债券发行系统
     */
    @Column(name = "BIDD_ISSUE_SYSTEM")
    private String biddIssueSystem;

    /**
     * 是否违约 0:否 1:是
     */
    @Column(name = "IS_DEFAULT")
    private String defaultField;

    /**
     * 前台现金流计息基准
     */
    @Column(name = "CF_DAYCOUNT")
    private String cfDaycount;

    /**
     * 后台应计利息计息基准
     */
    @Column(name = "AI_DAYCOUNT_BACK")
    private String aiDaycountBack;

    /**
     * 后台到期收益率计息基准
     */
    @Column(name = "YTM_DAYCOUNT_BACK")
    private String ytmDaycountBack;

    /**
     * 后台现金流计息基准
     */
    @Column(name = "CF_DAYCOUNT_BACK")
    private String cfDaycountBack;

    /**
     * 法定到期日
     */
    @Column(name = "LEGAL_MTR_DATE")
    private String legalMtrDate;

    /**
     * 计划发行量
     */
    @Column(name = "B_PLAN_ISSUE_AMOUNT")
    private String bPlanIssueAmount;

    /**
     * 穿透主体
     */
    @Column(name = "PENETRATEISSUER")
    private String penetrateissuer;

    /**
     * 维好协议方
     */
    @Column(name = "KEEPWELL_AGREEMENTOR")
    private String keepwellAgreementor;

    /**
     * 备用信用证开证行
     */
    @Column(name = "B_SBLC_BANK")
    private String bSblcBank;

    /**
     * 债项首次评级
     */
    @Column(name = "B_FST_EXT_RATING")
    private String bFstExtRating;

    /**
     * 债项首次评级机构
     */
    @Column(name = "B_FST_EXT_RATING_INST")
    private String bFstExtRatingInst;

    /**
     * 发行人首次评级
     */
    @Column(name = "B_FST_ISSUER_EXT_RATING")
    private String bFstIssuerExtRating;

    /**
     * 发行人首次评级机构
     */
    @Column(name = "B_FST_ISSUER_EXT_R_INST")
    private String bFstIssuerExtRInst;

    /**
     * 基础资产类型名称(仅对ABS债券有效)
     */
    @Column(name = "B_AS_ASSET_TYPE_NAME")
    private String bAsAssetTypeName;

    /**
     * 下个行权日
     */
    @Column(name = "NEXT_EXERCISE_DATE")
    private String nextExerciseDate;

    /**
     * 发行金额上限(亿元)
     */
    @Column(name = "B_ISSUE_AMOUNT_LIMIT")
    private String bIssueAmountLimit;

    /**
     * 风控主体2
     */
    @Column(name = "PENETRATEISSUER2")
    private String PENETRATEISSUER2;

    /**
     * 浮动利率债首周期定息日
     */
    @Column(name = "B_INITIAL_FIXING_DATE")
    private String bInitialFixingDate;

    /**
     * 浮动利率债首周期定息利率
     */
    @Column(name = "B_INITIAL_RATE")
    private String bInitialRate;

    /**
     * 浮动利率债利率上限（初始）
     */
    @Column(name = "B_CAP_RATE")
    private String bCapRate;

    /**
     * 浮动利率债利率下限（初始）
     */
    @Column(name = "B_FLOOR_RATE")
    private String bFloorRate;

    /**
     * 浮动利率债定息精度
     */
    @Column(name = "B_FIXING_PRECISION")
    private String bFixingPrecision;

    /**
     * 期限结构
     */
    @Column(name = "TERM_DESC")
    private String termDesc;

    /**
     * 交收方式（交易所）：数据由衡泰数据导入，0：非担保交收 ；1：担保交收；空值：官网未披露此信息
     */
    @Column(name = "WARRANT_SETTLEMENT")
    private String warrantSettlement;

    /**
     * 债券唯一编码
     */
    @Column(name = "SEC_CODE")
    private String secCode;

    /**
     * ISIN码
     */
    @Column(name = "ISIN_CODE")
    private String isinCode;

    /**
     * 资产证券化类型，其中1开头的为’信贷资产证券化’，2开头的为’企业资产证券化’：1001：企业信贷资产；1002：汽车抵押贷款；1003：个人住房抵押贷款；1004：租赁资产；1005：信用卡应收账款；1006：个人消费贷款；1007：商业房地产抵押贷款；1008：中小企业贷款；1009：不良资产重组；2001：企业信贷资产；2002：租赁资产；2003：企业应收账款；2004：委托贷款；2005：信托受益权；2006：BT项目回购；2007：BOT项目；2008：入园凭证；2009：收费收益权；2010：REITs；2011：保理融资债权；2012：两融债权；2013：股票质押式回购债权；2014：购房尾款；2015：小额贷款；2016：住房公积金
     */
    @Column(name = "B_ABS_CLASS")
    private String bAbsClass;

    /**
     * 底层资产类型
     */
    @Column(name = "B_AS_ASSET_TYPE")
    private String bAsAssetType;

    /**
     * 累进利率 0：否 1：是
     */
    @Column(name = "IS_PROGRESS_RATE")
    private String progressRate;

    /**
     * 是否单券
     */
    @Column(name = "IS_SINGLE")
    private String single;

    /**
     * 发行状态 0:成功 1:失败
     */
    @Column(name = "ISSUE_STATUS")
    private String issueStatus;

    /**
     * 是否权益类，0：金融负债，1：权益工具
     */
    @Column(name = "IS_EQUITY_TOOL")
    private String equityTool;

    /**
     * 未来付息日
     */
    @Column(name = "FUTURE_PAY_DATE")
    private String futurePayDate;

    /**
     * 二级分类（ABS债券使用）
     */
    @Column(name = "P_CLASS_SECONDARY")
    private String pClassSecondary;

    /**
     * 分层
     */
    @Column(name = "B_LAYER")
    private String bLayer;

    /**
     * 分档
     */
    @Column(name = "B_LEVEL")
    private String bLevel;

    /**
     * OGN
     */
    @Column(name = "B_TRUSTEE")
    private String bTrustee;

    /**
     * 主承
     */
    @Column(name = "B_LEAD_UNDERWRITER")
    private String bLeadUnderwriter;

    /**
     * 自定义字段C1
     */
    @Column(name = "C1")
    private String c1;

    /**
     * 自定义字段C2
     */
    @Column(name = "C2")
    private String c2;

    /**
     * 自定义字段C3
     */
    @Column(name = "C3")
    private String c3;

    /**
     * 自定义字段C4
     */
    @Column(name = "C4")
    private String c4;

    /**
     * 自定义字段C5
     */
    @Column(name = "C5")
    private String c5;

    /**
     * 提前披露受托报告天数
     */
    @Column(name = "PRE_PUBREPORT_DAY")
    private String prePubreportDay;

    /**
     * 是否商业银行二级资本债，0：否；1：是
     */
    @Column(name = "IS_TIER2CAPITAL")
    private String tier2capital;

    /**
     * ABS底层资产(自定义)
     */
    @Column(name = "B_ABS_ASSET_CUSTOM")
    private String bAbsAssetCustom;

    /**
     * 自定义类型,0:城投债,1:非金融产业债,2:金融产业债
     */
    @Column(name = "CUSTOM_BOND_TYPE")
    private String customBondType;

    /**
     * 是否只能机构投资者购买
     */
    @Column(name = "IS_INST_INVESTOR_BUY")
    private String instInvestorBuy;

    /**
     * 免税情况，0:全免,1:半免,2:不免
     */
    @Column(name = "EXEMPTION_STATUS")
    private String exemptionStatus;

    /**
     * 利息税率
     */
    @Column(name = "B_TAX_RATE")
    private String bTaxRate;

    /**
     * 主体类型
     */
    @Column(name = "SUBJECTTYPE")
    private String subjecttype;

    /**
     * STG
     */
    @Column(name = "B_ABS_TOTAL_YTM")
    private String bAbsTotalYtm;

    /**
     * EXP
     */
    @Column(name = "B_EXP")
    private String bExp;

    /**
     * 组别
     */
    @Column(name = "B_GROUP_TYPE")
    private String bGroupType;

    /**
     * 债券分类
     */
    @Column(name = "P_CLASS3")
    private String pClass3;

    /**
     * 上市市场
     */
    @Column(name = "L_MARKET")
    private String lMarket;

    /**
     * 行权类型描述
     */
    @Column(name = "OPTION_DESC")
    private String optionDesc;

    /**
     * ABS次级档超额收益备注
     */
    @Column(name = "REMARK_ABS")
    private String remarkAbs;

    /**
     * 是否AT1债
     */
    @Column(name = "IS_AT1")
    private String at1;

    /**
     * CMU代码
     */
    @Column(name = "CMU_CODE")
    private String cmuCode;

    /**
     * 特殊条款说明
     */
    @Column(name = "SPECIAL_DESC")
    private String specialDesc;

    /**
     * 公告代码
     */
    @Column(name = "ISSUECODE")
    private String issuecode;

    /**
     * 原始权益人(内部)(ABS扩展字段)
     */
    @Column(name = "ORIGINAL_OWNER")
    private String originalOwner;

    /**
     * 资产类型大类(ABS扩展字段)
     */
    @Column(name = "ASSET_TYPEB")
    private String assetTypeb;

    /**
     * 资产类型细类(ABS扩展字段)
     */
    @Column(name = "ASSET_TYPES")
    private String assetTypes;

    /**
     * 信用主体(ABS扩展字段)
     */
    @Column(name = "CREDIT_SUBJECT")
    private String creditSubject;

    /**
     * 项目类型(ABS扩展字段)
     */
    @Column(name = "PROJECT_TYPE")
    private String projectType;

    /**
     * 首个付息日
     */
    @Column(name = "B_FST_PAY_DATE")
    private String bFstPayDate;

    /**
     * 集团系
     */
    @Column(name = "ABS_TAG")
    private String absTag;

    /**
     * 重资产重信用标签  1重信用，2重资产
     */
    @Column(name = "ADD_CREDIT_ASSETS")
    private String addCreditAssets;

    /**
     * 推荐风控主体，多个以;分隔
     */
    @Column(name = "RISK_COMP_NAME")
    private String riskCompName;

    /**
     * 是否城投(外部渠道)
     */
    @Column(name = "IS_CITY_INVESTMENT_OUT")
    private String cityInvestmentOut;

    /**
     * 增值税免税情况，0:全免,1:半免,2:不免
     */
    @Column(name = "VALUE_TAX_STATUS")
    private String valueTaxStatus;

    /**
     * 预期期间收益率下限
     */
    @Column(name = "EXPECT_YIELD_FLOOR")
    private String expectYieldFloor;

    /**
     * 预期期间收益率上限
     */
    @Column(name = "EXPECT_YIELD_CAP")
    private String expectYieldCap;

}
